package cn.yuanqiao.archive.storeRoom.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 档案格对象 YQGRID
 * 
 * @author xy
 * @date 2023-06-20
 */
public class Grid extends BaseEntity
{
    private static final long serialVersionUID = 1L;


    private final String BIGTABLENAME = "_YQGRID";

    public Grid() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
            //throw new ServiceException("tenantCode is null");
            this.tableName="YQGRID";
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }

    /** ID */
    @IdAnnotation
    private Long gridId;

    /** 柜子id */
    @Excel(name = "柜子id")
    private Long shelfId;


    /** 档案格coce */
    @Excel(name = "档案格coce")
    private String gridCode;

    /** 档案格名字 */
    @Excel(name = "档案格名字")
    private String gridName;

    /** AB面分类 */
    @Excel(name = "AB面分类")
    private String gridSide;

    /** 格子宽度(mm) */
    @Excel(name = "格子宽度(mm)")
    private Integer gridWidth;

    /** 格子预留宽度 */
    @Excel(name = "格子预留宽度")
    private Integer gridPrewidth;

    /** 第几排 */
    @Excel(name = "第几排")
    private Integer gridCrsnum;

    /** 第几列 */
    @Excel(name = "第几列")
    private Integer gridStdnum;

    /** 剩余宽度(mm) */
    @Excel(name = "剩余宽度(mm)")
    private Integer syWidth;

    /** 盒子占用宽度(mm) */
    @Excel(name = "盒子占用宽度(mm)")
    private Integer useWidth;

    /** 装有盒子数（个） */
    @Excel(name = "装有盒子数", readConverterExp = "个=")
    private Integer putawayNum;

    /** 创建人 */
    @Excel(name = "创建人")
    private Long creator;

    /** 最后修改人 */
    @Excel(name = "最后修改人")
    private Long lastupdater;

    /** 最后修改时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastupdateTime;


    private String tableName;

    private String shelfName;

    public void setGridId(Long gridId) 
    {
        this.gridId = gridId;
    }

    public Long getGridId() 
    {
        return gridId;
    }
    public void setShelfId(Long shelfId)
    {
        this.shelfId = shelfId;
    }

    public Long getShelfId()
    {
        return shelfId;
    }
    public void setGridCode(String gridCode) 
    {
        this.gridCode = gridCode;
    }

    public String getGridCode() 
    {
        return gridCode;
    }
    public void setGridName(String gridName) 
    {
        this.gridName = gridName;
    }

    public String getGridName() 
    {
        return gridName;
    }
    public void setGridSide(String gridSide) 
    {
        this.gridSide = gridSide;
    }

    public String getGridSide() 
    {
        return gridSide;
    }
    public void setGridWidth(Integer gridWidth) 
    {
        this.gridWidth = gridWidth;
    }

    public Integer getGridWidth() 
    {
        return gridWidth;
    }
    public void setGridPrewidth(Integer gridPrewidth) 
    {
        this.gridPrewidth = gridPrewidth;
    }

    public Integer getGridPrewidth() 
    {
        return gridPrewidth;
    }
    public void setGridCrsnum(Integer gridCrsnum) 
    {
        this.gridCrsnum = gridCrsnum;
    }

    public Integer getGridCrsnum() 
    {
        return gridCrsnum;
    }
    public void setGridStdnum(Integer gridStdnum) 
    {
        this.gridStdnum = gridStdnum;
    }

    public Integer getGridStdnum() 
    {
        return gridStdnum;
    }
    public void setSyWidth(Integer syWidth) 
    {
        this.syWidth = syWidth;
    }

    public Integer getSyWidth() 
    {
        return syWidth;
    }
    public void setUseWidth(Integer useWidth) 
    {
        this.useWidth = useWidth;
    }

    public Integer getUseWidth() 
    {
        return useWidth;
    }
    public void setPutawayNum(Integer putawayNum) 
    {
        this.putawayNum = putawayNum;
    }

    public Integer getPutawayNum() 
    {
        return putawayNum;
    }
    public void setCreator(Long creator) 
    {
        this.creator = creator;
    }

    public Long getCreator() 
    {
        return creator;
    }
    public void setLastupdater(Long lastupdater) 
    {
        this.lastupdater = lastupdater;
    }

    public Long getLastupdater() 
    {
        return lastupdater;
    }
    public void setLastupdateTime(Date lastupdateTime)
    {
        this.lastupdateTime = lastupdateTime;
    }

    public Date getLastupdateTime()
    {
        return lastupdateTime;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }


    public String getShelfName() {
        return shelfName;
    }

    public void setShelfName(String shelfName) {
        this.shelfName = shelfName;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("gridId", getGridId())
            .append("shelfId", getShelfId())
            .append("gridCode", getGridCode())
            .append("gridName", getGridName())
            .append("gridSide", getGridSide())
            .append("gridWidth", getGridWidth())
            .append("gridPrewidth", getGridPrewidth())
            .append("gridCrsnum", getGridCrsnum())
            .append("gridStdnum", getGridStdnum())
            .append("syWidth", getSyWidth())
            .append("useWidth", getUseWidth())
            .append("putawayNum", getPutawayNum())
            .append("creator", getCreator())
            .append("createTime", getCreateTime())
            .append("lastupdater", getLastupdater())
            .append("lastupdateTime", getLastupdateTime())
            .append("tableName", getTableName())
            .toString();
    }
}
